import request from '@/utils/request'
var PATH = "/commodity"
export default {
    //推荐商品
    getListComm(page, size, key) {
        return request({
            url: `${PATH}/listTop?page=${page}&size=${size}&key=${key}`,
            method: "get"
        })
    },
    //秒杀商品
    getListSpike(page, size, key) {
        return request({
            url: `${PATH}/spike?page=${page}&size=${size}&key=${key}`,
            method: "get"
        })
    },

    //id查询商品
    getByID(id) {
        return request({
            url: `${PATH}/info/${id}`,
            method: "get"
        })
    },


    //收藏的商品
    getListCollect(page, size, key) {
        return request({
            url: `${PATH}/listUser?page=${page}&size=${size}&key=${key}`,
            method: "get"
        })
    },
    /**
     *  搜索商品
     * @param { } page 
     * @param {*} size 
     * @param {*} key 
     * @returns 
     */
    getListss(page, size, key) {
        return request({
            url: `${PATH}/list?page=${page}&size=${size}&key=${key}`,
            method: "get"
        })
    }
}